package cc.facesign.admin.enums;

public enum GenderType {
    ZERO(0, "女"),
    ONE(1, "男"),
    TWO(2, "未知");

    private final Integer code;
    private final String msg;

    private GenderType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String codeOf(Integer code) {
        for (GenderType e : values()) {
            if (code.equals(e.code)) {
                return e.msg;
            }
        }
        return null;
    }

    public static Integer deCodeOf(String msg) {
        for (GenderType e : values()) {
            if (e.msg.equals(msg)) return e.code;
        }
        return null;
    }


}
